﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Rubik.Database.Enums;
using Rubik.Database.Objects;

namespace Rubik.Database.Tools.Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Table test = new Table();
            test.Name = "TESTABLOSU";

            TableColumn PKCol = new TableColumn(test);
            PKCol.Name = "PK";
            PKCol.Nullable = false;
            PKCol.ColumnType = DataTypes.NUMBER;
            test.Columns.Add(PKCol);

            TableColumn col1 = new TableColumn(test);
            col1.Name = "ADI";
            col1.Nullable = false;
            col1.ColumnType = DataTypes.VARCHAR2;
            col1.ValueLength = 50;
            test.Columns.Add(col1);

            col1 = new TableColumn(test);
            col1.Name = "SOYADI";
            col1.Nullable = true;
            col1.ColumnType = DataTypes.VARCHAR2;
            col1.ValueLength = 100;
            test.Columns.Add(col1);

            Objects.Keys pk = new Objects.Keys();
            pk.Name = "PK_TESTTABLE_KEY";
            pk.KeyType = KeyTypes.Primary;
            pk.Owner = test;
            pk.Enabled = true;
            pk.Columns.Add(PKCol);

            test.KeyColumns.Add(pk);

            richTextBox1.Text = test.GetAlterColumnsSql(false,false);

        }
    }
}
